# import httplib
# import urllib
#
# host = "106.ihuyi.com"
# sms_send_uri = "/webservice/sms.php?method=Submit"
#
# # 查看用户名 登录用户中心->验证码通知短信>产品总览->API接口信息->APIID
# account = "C87846798"
# # 查看密码 登录用户中心->验证码通知短信>产品总览->API接口信息->APIKEY
# password = "68ce97ec2247552cbb0ed7a9125ea387"
#
#
# def send_sms(text, mobile):
#     params = urllib.urlencode(
#         {'account': account, 'password': password, 'content': text, 'mobile': mobile, 'format': 'json'})
#     headers = {"Content-type": "application/x-www-form-urlencoded", "Accept": "text/plain"}
#     conn = httplib.HTTPConnection(host, port=80, timeout=30)
#     conn.request("POST", sms_send_uri, params, headers)
#     response = conn.getresponse()
#     response_str = response.read()
#     conn.close()
#     return response_str
#
#
# if __name__ == '__main__':
#     mobile = "15146576104"
#     text = "您的验证码是：121254。请不要把验证码泄露给其他人。"
#
#     print(send_sms(text, mobile))
# 1. 导⼊FastDFS客户端扩展
from fdfs_client.client import Fdfs_client, get_tracker_conf
# 2. 创建FastDFS客户端实例
tracker_path =get_tracker_conf('D:\DongBaoWEB\mango-headlines\mgproject\mgproject\utils\ fastdfs\client.conf')
client = Fdfs_client(tracker_path)
# 3. 调⽤FastDFS客户端上传⽂件⽅法r
ret = client.upload_by_filename('C:\Users\lct\Desktop/1.jpeg')
#